From: Georges Basile Stavracas Neto Date: Tue, 2 Jul 2019 02:01:59 +0000 (-0300) Subject: baseAppView: Move _loadGrid() into _redisplay() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~77 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=036e41621d8c840fb99e29dd736a48883523b93a;p=gnome-shell.git baseAppView: Move _loadGrid() into _redisplay() Next commit will introduce differential loading of app icons, and will reorganize this part of the codebase. When doing that, the ideal symmetry of the new code would be: * Update BaseAppView._allItems array * Update BaseAppView._items map * Update BaseAppView._grid actor Move the code in _loadGrid() into _redisplay() so that we can check in-place which new icons need to be added. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index c235f87f8..b253fdb21 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -123,7 +123,10 @@ class BaseAppView { _redisplay() { this.removeAll(); this._loadApps(); - this._loadGrid(); + + this._allItems.sort(this._compareItems); + this._allItems.forEach(item => this._grid.addItem(item)); + this.emit('view-loaded'); } getAllItems() { @@ -147,12 +150,6 @@ class BaseAppView { return a.name.localeCompare(b.name); } - _loadGrid() { - this._allItems.sort(this._compareItems); - this._allItems.forEach(item => this._grid.addItem(item)); - this.emit('view-loaded'); - } - _selectAppInternal(id) { if (this._items[id]) this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false); @@ -338,6 +335,7 @@ var AllView = class AllView extends BaseAppView { openFolderId = this._currentPopup._source.id; super._redisplay(); + this._refilterApps(); if (openFolderId) { let [folderToReopen] = this.folderIcons.filter(folder => folder.id == openFolderId); @@ -420,11 +418,6 @@ var AllView = class AllView extends BaseAppView { }); } - _loadGrid() { - super._loadGrid(); - this._refilterApps(); - } - // Overridden from BaseAppView animate(animationDirection, onComplete) { this._scrollView.reactive = false;